<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    {% load static %}
    <link rel="stylesheet" type="text/css" href="{% static "css/index.css" %}">
    <script type="text/javascript" src="{% static "js/index.js" %}"></script>
    <title>分支助手</title>
</head>
<body>

<form method="post" action="/branchhelper/">
    {% csrf_token %}
    <div></div>
    <div>
        <label for="scales">git根路径:</label>
        <input type="text" class="inputtext90width" id="gitrootpath" name="gitrootpath" placeholder="输入比较git的根路径" value="{{ gitrootpath }}"/>
    </div>
    <div></div>
    <div>
        <label for="scales">分支:</label>
        <input type="text" class="inputtext90width" id="branches" name="branches" placeholder="输入分支名称，多个以分号分隔" value="{{ branches }}"/>
    </div>
    <div>
        <label for="scales">查找内容:</label>
        <textarea class="textarea90widthheight150" id="searchtext" name="searchtext" placeholder="输入查找内容" >{{ searchtext }}</textarea>
    </div>
    <div>
        <label for="scales">是否显示差异:</label>
        {% if isshowdiff == "" %}
            <input type="checkbox" id="isshowdiff" name="isshowdiff"  />
        {% else %}
            <input type="checkbox" id="isshowdiff" name="isshowdiff" checked />
        {% endif %}


  </div>
    <div><input type="button" value="清 空" onclick="clearsearchtextContent()">
        <input type="submit" value="计算结果"></div>
</form>
{#<h1>计算结果:</h1>#}

{% if calcresult != "" %}
    <hr/>
    {{ calcresult }}
{% endif %}

{% if gitrootpath == "" %}
    <div style="color: red">查找路径为空，请输入数据!!!</div>
{% else %}
    <div style="color: black">查找路径：{{ gitrootpath }}</div>
{% endif %}


{% if branches == "" %}
    <div style="color: red">比较分支为空，请输入数据!!!</div>
{% else %}
    <div style="color: black">比较分支：{{ branches }} </div>
{% endif %}


{% if branches == "" %}
    <div style="color: red">查找字段为空，请输入数据!!!</div>
{% else %}
    <div style="color: black">查找字段：{{ searchtext }} </div>
{% endif %}



<div>
{#   <h1>分支查找结果：</h1>#}
    <div>
        <textarea class="textarea45width">{{ search_result1 }}</textarea>
        <textarea class="textarea45width">{{ search_result2 }}</textarea>
    </div>
</div>

    <hr/>
{% if isshowdiff != "" %}
    <div>
        <h1 style="color: blue">分支差异比较:</h1>

    {% if diff_result == "" %}
        <div style="color: red"></div>
    {% else %}
        <div style="color: black">分支差异为：</div>
        <div><textarea class="textarea90width">{{ diff_result }}</textarea></div>
    {% endif %}
    </div>
{% endif %}



</body>
</html>